var UIManage = require("UIManage");
cc.Class({
    extends: cc.Component,

    properties: {

    },


    onLoad() {
        // this.node.children[0].on("click", this._click, this);
        // this.showIconEffect();
        this.node.active=false;
        console.log("隐藏小红包")

        this.node.destroy();
    },

    showIconEffect() {

        this.node.children[0].runAction(
            cc.repeatForever(
                cc.sequence(
                    cc.scaleTo(0.1, 0.8, 1.2),
                    cc.scaleTo(0.1, 1.2, 0.8),
                    cc.scaleTo(0.1, 1, 1),
                    cc.delayTime(1)
                )
            )
        );
    },

    _click() {

        // 过关红包
        if (Utils.isPopRed()) {
            UIManage.Instance.ShowOpenMoney((src) => {
                src.init(3);
            });
        }
        this.node.removeFromParent();
    }

});
